package com.gs.common.util;

import com.gs.entity.UserEntity;

import com.gs.entity.UserEntity;

/**
 * @title: 孙杨申
 * @date 2022/5/28 10:27
 */
public class SecurityUtils {

    /**
     * 获取用户信息
     * @return
     */
    public static UserEntity getUser() {
        return (UserEntity)org.apache.shiro.SecurityUtils.getSubject().getPrincipal();
    }

    /**
     * 获取用户id
     * @return
     */
    public static Long getUserId() {
        return getUser().getId();
    }
}
